<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>房间时段修改</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	
	<link href="css/css-main.css" rel="stylesheet" type="text/css" />
	<script  type="text/javascript" src="<%=basePath%>js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
function submitForm(subType) {
    switch(subType)
    {
      case 1:
      {
        // 查询
		document.getElementById("queryPeriods").submit();
		break;
      }
      case 2:
      { 
        var form = document.getElementById("queryPeriods");
        form.action = "<%=basePath%>cms/bookinfo/doModOrderRoomPeriod.do";
        form.submit();
      }
      case 3:
      { 
        var form = document.getElementById("queryPeriods");
        form.action = "<%=basePath%>cms/bookinfo/doCancelModPeriod.do";
        form.submit();
      }
      default:break;
    }
  
}

     
	  
</script>

<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
  </head>
  
  <body>
    <form name ="queryPeriods" id="queryPeriods" action="cms/bookinfo/doQueryPeriods.do">
    <div class="main-con">
     <!--//导航位置层-->
      <div class="cont_right_cont">
        
        <fieldset>
          <legend>订房信息</legend>
             
          <div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
             
              <tr>
                <td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
                    
                    <tr>
                      <td align="right" height="40">房间号：</td>
                      <td colspan="5">
                      <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                           <td>
                           <input type="hidden" name="roomInfo.innerIndex" value='<s:property value="roomInfo.innerIndex"/>'/>
                            <input type="hidden" name="bookOrderInfo.innerIndex"  value="<s:property value="bookOrderInfo.innerIndex"/>"/>
                           </td>
                          <td style="padding:0px"><input name="roomInfo.roomNum" type="text" class="data-searchtxt-runtime"id="roomNum" value='<s:property value="roomInfo.roomNum"/>' disabled="disabled"/></td>
                        </tr>
                      </table>
                      </td>
                    </tr>
                    <tr>
                      <td align="right" height="40">开始时间：</td>
                      <td width="11%"><input id="startTime" value='<s:property value="startTime"/>' name="startTime" type="text"
									class="data-searchtxt-time"
									onFocus="var endTime=$dp.$('endTime');WdatePicker({onpicked:function(){endTime.focus();},skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'%y-%M-%d %H:%m',maxDate:'#F{$dp.$D(\'endTime\',{m:-10})}'});" /></td>
                      <td width="11%" align="right">结束时间：</td>
                      <td width="21%"><input id="endTime" name="endTime" type="text" value='<s:property value="endTime"/>'
									class="data-searchtxt-time"
									onFocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTime\',{m:10});}',maxDate:'2099-10-01'});" /></td>
                      <td width="22%"><input name="submit1" type="submit" class="data-searchbtn" id="button"  value="查 询" onclick="submitForm(1);"/></td>
                    </tr>
                  </table>
                 </td>
              </tr>
            </table>
            </div>
            
            </fieldset>
          
           <div class="timelist" align="center" style="background-color:#D2FFFF" >     

              <table width="50%" border="0" >
                 <s:if test="results.size == 0">
                                                                              暂无可预订房间信息
                 </s:if>
                 <s:else>
                    <s:if test="(roomInfo.roomTypeInfo.roomTypeId == 6) ||  (roomInfo.roomTypeInfo.roomTypeId == 7)">
                        <td colspan="6" align="left"  height="30">请选择桌次时段：</td>
                    </s:if> 
                    <s:else>
                      <tr>                
                        <td colspan="6" align="left"  height="30">请选择房间时段：</td>
                      </tr>
                    </s:else>     
                                                                        
                   <s:iterator value="results" status="e">
                     <s:if test="#e.index%3==0">
                       <tr>
                     </s:if>
                       <td width="5%" valign="middle"  height="30"><input type="checkbox" name="innerIndexs" value='<s:property value="results[#e.index].innerIndex"/>' id="innerIndexs"
                        <s:if test="status == 1">
                         checked="checked"
                        </s:if>
                        ></td>&nbsp;
                       <td  nowrap align="left" valign="middle"  height="30"><label ><s:date name="startTime" format="yy-MM-dd HH:mm"/>—</label><s:date name="endTime" format="yy-MM-dd HH:mm"/>&nbsp;</td>
                     <s:if test="#e.index%3==2">
                       </tr>
                     </s:if>
                   </s:iterator>
                   </s:else>
                </table>
              <table width="100%" border="0">
                <tr>
                  <td width="39%" align="right" height="40">单价：</td>
                  <td width="61%"><table border="0" cellpadding="0" cellspacing="0">
                    <tr >
                      <td style="padding:0px">
                       <s:if test="tableNo == null">
                           <s:property value="roomInfo。originalPricePerRoom"/>
                       </s:if>
                       <s:else>
                            <s:property value="tableNoInfo。originalPricePerTable"/>
                       </s:else>
                      
                      </td>
                      <td>元/小时</td>
                    </tr>
                  </table>
                </tr>
              </table>
             
            </div>
            
            <div align="center">
              <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                <tr>
                  <td width="50%" align="right"><input name="continueBookingBtn"  type="button" class="btn-Yes" id="continueBookingBtn" value="确认修改" onclick="submitForm(2);"
                   <s:if test="results.size == 0">
                      disabled="disabled"
                   </s:if>> </td>
                  <td width="50%" align="left"><input name="next" type="button" class="btn-Yes" id="next"  value="取消修改" onclick="submitForm(3);"></td>
                </tr>
              </table>
            </div>
    </div>
    </div>
    </form>
  </body>
</html>
